/**
 * @author abcque
 * @version 1.0
 * @ className LogicOperator
 * @ description 逻辑运算符
 * @ date 2022/10/28 9:10
 */
public class LogicOperator {
    public static void main(String[] args) {
        /*int x = 1;
        int y = 1;
        // 与运算
        boolean b = x++ == 2 & ++y == 2;
        System.out.println(x);
        System.out.println(y);
        System.out.println(b);*/

        /*int x = 1;
        int y = 1;
        // 短路与运算，第一个操作数为假时，不对第二个操作数进行处理
        boolean b = x++ == 2 && ++y == 2;
        System.out.println(x);
        System.out.println(y);
        System.out.println(b);*/

        /*int x = 1;
        int y = 1;
        // 或运算
        boolean b = x++ == 1 | ++y == 1;
        System.out.println(x);
        System.out.println(y);
        System.out.println(b);*/

        int x = 1;
        int y = 1;
        // 短路或运算，第一个操作数为真时，不对第二个操作数进行处理
        boolean b = x++ == 1 || ++y == 1;
        System.out.println(x);
        System.out.println(y);
        System.out.println(b);

    }
}
